<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>用户表</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="online/template/ledefault/css/vendor.css">
<link rel="stylesheet"
	href="online/template/ledefault/css/bootstrap-theme.css">
<link rel="stylesheet"
	href="online/template/ledefault/css/bootstrap.css">
<link rel="stylesheet" href="online/template/ledefault/css/app.css">

<link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css"
	type="text/css" />
<link rel="stylesheet"
	href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css" />

<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
<script type="text/javascript"
	src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
<script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
<script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
<script type="text/javascript"
	src="plug-in/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
<script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
<script type="text/javascript"
	src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
<script type="text/javascript"
	src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
<script type="text/javascript"
	src="plug-in/Validform/js/datatype_zh-cn.js"></script>
<script type="text/javascript"
	src="plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
<link rel="stylesheet"
	href="plug-in/umeditor/themes/default/css/umeditor.css" type="text/css"></link>
<script type="text/javascript" src="plug-in/umeditor/umeditor.config.js"></script>
<script type="text/javascript" src="plug-in/umeditor/umeditor.min.js"></script>
<script type="text/javascript"
	src="plug-in/umeditor/lang/zh-cn/zh-cn.js"></script>
<link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css"
	type="text/css" />
<script type="text/javascript"
	src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
<script type="text/javascript">
	//编写自定义JS代码
</script>
</head>

<body>
	<t:formvalid formid="formobj" dialog="true" usePlugin="password"
		layout="div" action="xyhJzUserController.do?doUpdate" tiptype="1"
		callback="jeecgFormFileCallBack@Override">
		<input type="hidden" id="btn_sub" class="btn_sub" />
		<input type="hidden" name="id" value='${xyhJzUserPage.id}'>
		<input type="hidden" name="nickname" value='${xyhJzUserPage.nickname}'>

		<div class="tab-wrapper">
			<!-- tab -->
			<ul class="nav nav-tabs">
				<li role="presentation" class="active"><a
					href="javascript:void(0);">用户信息</a></li>
			</ul>
			<!-- tab内容 -->
			<div class="con-wrapper" id="con-wrapper1" style="display: block;">
				<div class="row form-wrapper">
					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>用户名：</b>
						</div>
						<div class="col-xs-3">${xyhJzUserPage.nickname}</div>
					</div>

					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>密码：</b>
						</div>
						<div class="col-xs-5">
							<input id="pwd" name="pwd" type="password" class="form-control"
								readonly="true" datatype="*6-16" value='${xyhJzUserPage.pwd}'>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">密码</label>
						</div>
					</div>



					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>性别：</b>
						</div>
						<div class="col-xs-3">
							<t:dictSelect field="sex" type="list" readonly="true"
								extendJson="{class:'form-control'}" typeGroupCode="sex"
								defaultVal="${xyhJzUserPage.sex}" hasLabel="false" title="性别"></t:dictSelect>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">性别</label>
						</div>
					</div>

					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>手机号：</b>
						</div>
						<div class="col-xs-5">
							<input id="phone" name="phone" type="text" class="form-control"
								datatype="m" value='${xyhJzUserPage.phone}'> <span
								class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">手机号</label>
						</div>
					</div>

					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>qq：</b>
						</div>
						<div class="col-xs-5">
							<input id="qq" name="qq" type="text" class="form-control"
								value='${xyhJzUserPage.qq}'> <span
								class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">qq</label>
						</div>
					</div>


					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>是否校验手机号：</b>
						</div>
						<div class="col-xs-3">
							<t:dictSelect field="isCheckPhone" type="list"
								extendJson="{class:'form-control'}" typeGroupCode="sf_yn"
								defaultVal="${xyhJzUserPage.isCheckPhone}" hasLabel="false"
								title="是否校验手机号"></t:dictSelect>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">是否校验手机号</label>
						</div>
					</div>


					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>邮箱：</b>
						</div>
						<div class="col-xs-5">
							<input id="email" name="email" type="text" class="form-control"
								datatype="e" value='${xyhJzUserPage.email}'> <span
								class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">邮箱</label>
						</div>
					</div>


					<!-- <div class="row show-grid">
			          <div class="col-xs-3 text-center">
			          	<b>头像：</b>
			          </div>
			          <div class="col-xs-7">
								<table id="fileTable"></table>
									<script type="text/javascript">
										var serverMsg="";
										$(function(){
											$('#img').uploadify({
												buttonText:'添加文件',
												auto:false,
												progressData:'speed',
												multi:true,
												height:25,
												overrideEvents:['onDialogClose'],
												fileTypeDesc:'文件格式:',
												queueID:'filediv_file',
												fileTypeExts:'*.jpg;*.gif;*.png',
												fileSizeLimit:'5MB',
												 uploadLimit: 1,
												swf:'plug-in/uploadify/uploadify.swf',	
												uploader:'cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
												onUploadStart : function(file) { 
													var cgFormId=$("input[name='id']").val();
													$('#img').uploadify("settings", "formData", {
														'cgFormId':cgFormId,
														'cgFormName':'xyh_jz_user',
														'cgFormField':'IMG'
													});
												} ,
												onUploadError:function(){
													alert("上传错误！");
												},
												onQueueComplete : function(queueData) {
													 var win = frameElement.api.opener;
													 win.reloadTable();
													 win.tip(serverMsg);
													 frameElement.api.close();
												},
												onUploadSuccess : function(file, data, response) {
													var d=$.parseJSON(data);
													if(d.success){
														var win = frameElement.api.opener;
														serverMsg = d.msg;
													}
												},
												onFallback: function() {
								                    tip("您未安装FLASH控件，无法上传图片！请安装FLASH控件后再试")
								                },
								                onSelectError: function(file, errorCode, errorMsg) {
								                    switch (errorCode) {
								                    case - 100 : tip("上传的文件数量已经超出系统限制的" + $('#file').uploadify('settings', 'queueSizeLimit') + "个文件！");
								                        break;
								                    case - 110 : tip("文件 [" + file.name + "] 大小超出系统限制的" + $('#file').uploadify('settings', 'fileSizeLimit') + "大小！");
								                        break;
								                    case - 120 : tip("文件 [" + file.name + "] 大小异常！");
								                        break;
								                    case - 130 : tip("文件 [" + file.name + "] 类型不正确！");
								                        break;
								                    }
								                },
								                onUploadProgress: function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {}
											});
										});
									</script>
									<span id="file_uploadspan"><input type="file" name="img" id="img" /></span> 
									<div class="form" id="filediv_file"></div>
						<span class="Validform_checktip" style="float:left;height:0px;"></span>
						<label class="Validform_label" style="display: none">头像</label>
			          </div>
						</div> -->


					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>描述：</b>
						</div>
						<div class="col-xs-8">
							<textarea id="description" class="form-control" rows="6"
								name="description">${xyhJzUserPage.description}</textarea>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">描述</label>
						</div>
					</div>


					<div class="row show-grid">
						<div class="col-xs-3 text-center">
							<b>会员等级：</b>
						</div>
						<div class="col-xs-3">
							<t:dictSelect field="rank" type="list"
								extendJson="{class:'form-control'}" typeGroupCode="mem_rank"
								defaultVal="${xyhJzUserPage.rank}" hasLabel="false" title="会员等级"></t:dictSelect>
							<span class="Validform_checktip" style="float:left;height:0px;"></span>
							<label class="Validform_label" style="display: none">会员等级</label>
						</div>
					</div>


					<div class="row" id="sub_tr" style="display: none;">
						<div class="col-xs-12 layout-header">
							<div class="col-xs-6"></div>
							<div class="col-xs-6">
								<button type="button" onclick="neibuClick();"
									class="btn btn-default">提交</button>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
		</div>
	</t:formvalid>
	<script type="text/javascript">
		//加载 已存在的 文件
		$(function() {
			var table = $("#fileTable");
			var cgFormId = $("input[name='id']").val();
			$
					.ajax({
						type : "post",
						url : "xyhJzUserController.do?getFiles&id=" + cgFormId,
						success : function(data) {
							var arrayFileObj = jQuery.parseJSON(data).obj;

							$
									.each(
											arrayFileObj,
											function(n, file) {
												var tr = $("<tr style=\"height:34px;;\"></tr>");
												var td_title = $("<td>"
														+ file.title + "</td>")
												var td_download = $("<td>&nbsp;<a href=\"commonController.do?viewFile&fileid="
														+ file.fileKey
														+ "&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity\" title=\"下载\">下载</a> |</td>")
												var td_view = $("<td><a href=\"javascript:void(0);\" onclick=\"openwindow('预览','commonController.do?openViewFile&fileid="
														+ file.fileKey
														+ "&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity','fList',700,500)\">预览</a>|</td>");
												var td_del = $("<td><a href=\"javascript:void(0)\" class=\"jeecgDetail\" onclick=\"del('cgUploadController.do?delFile&id="
														+ file.fileKey
														+ "',this)\">删除</a></td>");

												tr.appendTo(table);
												td_title.appendTo(tr);
												td_download.appendTo(tr);
												td_view.appendTo(tr);
												td_del.appendTo(tr);
											});
						}
					});
		})
		function jeecgFormFileCallBack(data) {
			if (data.success == true) {
				uploadFile(data);
			} else {
				if (data.responseText == '' || data.responseText == undefined) {
					$.messager.alert('错误', data.msg);
					$.Hidemsg();
				} else {
					try {
						var emsg = data.responseText.substring(
								data.responseText.indexOf('错误描述'),
								data.responseText.indexOf('错误信息'));
						$.messager.alert('错误', emsg);
						$.Hidemsg();
					} catch (ex) {
						$.messager.alert('错误', data.responseText + '');
					}
				}
				return false;
			}
			if (!neibuClickFlag) {
				var win = frameElement.api.opener;
				win.reloadTable();
			}
		}
		function upload() {
			$('#img').uploadify('upload', '*');
		}

		var neibuClickFlag = false;
		function neibuClick() {
			neibuClickFlag = true;
			$('#btn_sub').trigger('click');
		}
		function cancel() {
			$('#img').uploadify('cancel', '*');
		}
		function uploadFile(data) {
			if (!$("input[name='id']").val()) {
				if (data.obj != null && data.obj != 'undefined') {
					$("input[name='id']").val(data.obj.id);
				}
			}
			if ($(".uploadify-queue-item").length > 0) {
				upload();
			} else {
				if (neibuClickFlag) {
					alert(data.msg);
					neibuClickFlag = false;
				} else {
					var win = frameElement.api.opener;
					win.reloadTable();
					win.tip(data.msg);
					frameElement.api.close();
				}
			}
		}
	</script>

	<script type="text/javascript">
		$(function() {
			//查看模式情况下,删除和上传附件功能禁止使用
			if (location.href.indexOf("load=detail") != -1) {
				$(".jeecgDetail").hide();
			}

			if (location.href.indexOf("mode=read") != -1) {
				//查看模式控件禁用
				$("#formobj").find(":input").attr("disabled", "disabled");
			}
			if (location.href.indexOf("mode=onbutton") != -1) {
				//其他模式显示提交按钮
				$("#sub_tr").show();
			}
		});

		var neibuClickFlag = false;
		function neibuClick() {
			neibuClickFlag = true;
			$('#btn_sub').trigger('click');
		}
	</script>
</body>
<script src="webpage/com/jianzhi/user/xyhJzUser.js"></script>
</html>